
#ifndef STDTYPEDEF_H
#define STDTYPEDEF_H

#define RX_BIT RB1
#define TX_BIT RC7

#define PARITY_EVEN TRUE 

#define NULL (0x0000)
#define FULL (0xFFFF)

#define COUNTS_FOR_9600bps	0xAA
#define COUNTS_FOR_4800bps  0x41

#define _MAX_UWORD_		0xFFFF

typedef unsigned char T_UBYTE;
typedef unsigned short int T_UWORD;
typedef unsigned long int T_ULONG;
typedef unsigned char T_UFLAG;

typedef signed char T_SBYTE;
typedef signed short int T_SWORD;
typedef signed long int T_SLONG;

typedef struct
{
	T_UBYTE bit0 : 1;
	T_UBYTE bit1 : 1;
	T_UBYTE bit2 : 1;
	T_UBYTE bit3 : 1;
	T_UBYTE bit4 : 1;
	T_UBYTE bit5 : 1;
	T_UBYTE bit6 : 1;
	T_UBYTE bit7 : 1;
} T_BITFIELD8;

typedef struct
{
	T_UBYTE bit_0 : 1;
	T_UBYTE bit_1 : 1;
	T_UBYTE bit_2 : 1;
	T_UBYTE bit_3 : 1;
	T_UBYTE bit_4 : 1;
	T_UBYTE bit_5 : 1;
	T_UBYTE bit_6 : 1;
	T_UBYTE bit_7 : 1;
	T_UBYTE bit_8 : 1;
	T_UBYTE bit_9 : 1;
	T_UBYTE bit_10 : 1;
	T_UBYTE bit_11 : 1;
	T_UBYTE bit_12 : 1;
	T_UBYTE bit_13 : 1;
	T_UBYTE bit_14 : 1;
	T_UBYTE bit_15 : 1;
} T_BITFIELD16;

typedef struct
{
	T_UBYTE bit_0 : 1;
	T_UBYTE bit_1 : 1;
	T_UBYTE bit_2 : 1;
	T_UBYTE bit_3 : 1;
	T_UBYTE bit_4 : 1;
	T_UBYTE bit_5 : 1;
	T_UBYTE bit_6 : 1;
	T_UBYTE bit_7 : 1;
	T_UBYTE bit_8 : 1;
	T_UBYTE bit_9 : 1;
	T_UBYTE bit_10 : 1;
	T_UBYTE bit_11 : 1;
	T_UBYTE bit_12 : 1;
	T_UBYTE bit_13 : 1;
	T_UBYTE bit_14 : 1;
	T_UBYTE bit_15 : 1;
	T_UBYTE bit_16 : 1;
	T_UBYTE bit_17 : 1;
	T_UBYTE bit_18 : 1;
	T_UBYTE bit_19 : 1;
	T_UBYTE bit_20 : 1;
	T_UBYTE bit_21 : 1;
	T_UBYTE bit_22 : 1;
	T_UBYTE bit_23 : 1;
	T_UBYTE bit_24 : 1;
	T_UBYTE bit_25 : 1;
	T_UBYTE bit_26 : 1;
	T_UBYTE bit_27 : 1;
	T_UBYTE bit_28 : 1;
	T_UBYTE bit_29 : 1;
	T_UBYTE bit_30 : 1;
	T_UBYTE bit_31 : 1;
} T_BITFIELD32;

#define TRUE		(1u)
#define FALSE		(0u)
#define HIGH		(1u)
#define LOW			(0u)

typedef enum
{
FRAME_START,
FRAME_BIT0,
FRAME_BIT1,
FRAME_BIT2,
FRAME_BIT3,
FRAME_BIT4,
FRAME_BIT5,
FRAME_BIT6,
FRAME_BIT7,
FRAME_PARITY,
FRAME_STOP
}TE_FRAME_BITS;


#endif